<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript"
	src="<%=request.getContextPath()%>/StlyeFrame/js/jquery.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/StlyeFrame/js/chili-1.7.pack.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/StlyeFrame/js/jquery.easing.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/StlyeFrame/js/jquery.dimensions.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/StlyeFrame/js/jquery.accordion.js"></script>
<style type="text/css">
body {
	margin: 0px;
	padding: 0px;
	font-size: 12px;
	border-right: 3px #9DC6E1 solid;
	overflow:hidden;
	font-family:"Microsoft YaHei" !important;
	background-color:#424F62;
	color:#54DFA4;
}

#navigation {
	margin: 0px;
	padding: 0px;
	width: 149px;
}

#navigation a.head {
	cursor: pointer;
	background: url(<%=request.getContextPath()%>/StlyeFrame/img/main_34.gif) no-repeat scroll;
	display: block;
	font-weight: bold;
	margin: 0px;
	padding: 5px 0 5px 35px;
	text-align: left;
	font-size: 12px;
	text-decoration: none;
	color:#FFF !important;
}

#navigation ul {
	border-width: 0px;
	margin: 0px;
	padding: 0px;
	text-indent: 0px;
}

#navigation li {
	list-style: none;
	display: inline;
}

#navigation li li a {
	display: block;
	font-size: 12px;
	text-decoration: none;
	text-align: center;
	padding: 3px;
}

#navigation li li a:hover {
	border-left:2px #999999 solid;
	background-color: #333;
	color:#FFF !important;
}

a:link {
	color: #FFF;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #54DFA4;
}
a:hover {
	text-decoration: none;
}
a:active {
	text-decoration: none;
}
.cur{
	border-left:3px #99FF00 solid;
	background-color:#1F302C;
	color:#FFF !important;
}
.hide{
	display: none;
}
.show{
	display: block;
}
</style>
</head>
<body>
<div style="height: 100%; margin-left: 2px;" id='btn-group'></div>
<script type="text/javascript">
var mianurl = "";
var lit =0 ;	
window.onload = function(id) {
	$.ajax({
				type : 'post',
				async : false,
				url : "<%=request.getContextPath()%>/login/MUList.do?id=" + id,
				dataType : 'json',// 返回数据类型
				success : function(data) {
					var sumAppend = "<ul id='navigation'>";
					$.each(data,
						   function(i, it) {
								    if (i != 0 && it.fid == 0) {
											sumAppend += "</ul></li>";
									}
									if (it.fid == 0) {
											sumAppend += "<li><a class='head'>"+it.menuName+"</a><ul>";
									} else {
										    if(i==1 && it.fid>0 && lit==0){mianurl='<%=request.getContextPath()%>'+it.functionParameters;}
											sumAppend += "<li><a href='<%=request.getContextPath()%>"
															+ it.functionParameters
															+ "' target='main'>"
															+ it.menuName
															+ "</a></li>";
											lit=lit+1;
											
										}
									});
							sumAppend += "</ul></li></ul>";
							$("#btn-group").append(sumAppend);
						}
					})
					$('#main', parent.document).attr("src",mianurl);
		};

		jQuery().ready(function() {
			jQuery('#navigation').accordion({
				header : '.head',
				navigation1 : true,
				event : 'click',
				fillSpace : true,
				animated : 'bounceslide'
			});
		});
	</script>
	<script type="text/javascript">
		$(document).ready(function() {
			$("body").on("click", "ul li ul li a", function(e) {
				$("ul li ul li a").removeClass("cur");
				$(e.target).addClass("cur");
			});
			$("body").on("click", "ul li a", function(e) {
				if (e.target.className === "head") {
					$("ul li ul").removeClass("show");
					$("ul li ul").removeClass("hide");
					$("ul li ul").addClass("hide");
					$(e.target).siblings().addClass("show");
				}
			});
		});
	</script>
</body>
</html>
